package cn.elwy.rcp.ui.explorer.editor;

import java.io.File;

import org.eclipse.ui.part.FileEditorInput;

import cn.elwy.rcp.ui.explorer.core.model.Operation;
import cn.elwy.rcp.ui.explorer.core.vo.ProjectConfig;
import cn.elwy.rcp.ui.wizard.WizardEditor;

public final class PackerEditor extends WizardEditor {

	public static final String ID = "cn.elwy.rcp.ui.explorer.editor.PackerEditor";

	@Override
	protected void initWizard() {
		FileEditorInput editorInput = (FileEditorInput) getEditorInput();
		File file = editorInput.getPath().toFile();
		wizard = new PackerEditorWizard(file, Operation.EDITOR);
		wizard.setEditor(this);
		ProjectConfig projectConfig = ((PackerEditorWizard) wizard).getProjectConfig();
		setPartName(projectConfig.getProjectName() + "_" + projectConfig.getVersion());
	}

}
